Skip to main content

All Questions

1vote
3answers
307views

I know I can create folders from a list.txt, but can I move files to those folders based on a mapping?

If right now, I only had a bunch of files dumped into a single directory, is there a way that I could move the files into a folder based on a mapping file. For example: A B 1 File Name Folder Name 2 ...
Nicole's user avatar
0votes
2answers
679views

Replace multiple lines and words using sed in a for loop

I have 2 files (mac and uid) with data on a Linux machine, that I want to carry to a "template", with a list, using sed to replace the data with variables. list.txt: CP00 CP01 mac.txt: FF-...
henrolos's user avatar
0votes
2answers
152views

How to remove the path in the column names from a text file in linux?

I have a tab-delimited text file data.txt that looks like the below: # Program used for this Geneid Chr Start End Strand Length /users/doc3/data/Q0062/input/HPR4/HPR4....
beginner's user avatar
2votes
4answers
363views

Count the occurrences comparing other file

I have two files: F1.txt: a:erwer|ee b:eeeee|eee c:ewrew|erwe and F2.txt: a.T1 a.T2 b.T3 C.T7 c.T4 I need to check the number of occurrences of the a,b,c keywords by checking F1.txt) from F2.txt. ...
rose's user avatar
2votes
3answers
1kviews

Create a new file with Names and path to the files in linux

I have several fastq.gz files, both R1 and R2 in a directory dir on a Linux system. It looks like: dir |____sampleA_1.fastq.gz |____sampleA_2.fastq.gz |____sampleB_1.fastq.gz |____sampleB_2.fastq....
stack_learner's user avatar
1vote
5answers
1kviews

Replace hyphen(s) with underscore(s) within angle brackets in a file

I’m aware of how to replace string; e.g., replace hyphen with underscore in a file. However, I wish to replace all hyphens with underscore for all text that falls within angle brackets in a given file....
Ashar's user avatar
0votes
2answers
792views

Renaming all files in the current directory to names listed in a text file

The original title was: Injecting vidir with vim like sequence of commands I have been trying to use vidir to rename multiple files which are accidently renamed by someone. Problem is vidir doesnt use ...
Tathastu Pandya's user avatar
0votes
1answer
836views

Only perform sed operations on lines starting with a particular string [closed]

I have the following file format Received from +11231231234 at 2021-10-10T19:56:50-07:00: This is a message that contains words like from, at, etc. Sent to +11231231234 at 2021-10-11T06:50:57+00:00: ...
jf4i2d's user avatar
-2votes
1answer
172views

Parse fixed width file and lookup those parsed values against Oracle Db

Files arrive within a specific time window (midnight-0600hrs EST) and get saved to the orders directory on the Linux host. these files are stored in a zip format. usually around 30 files are expected ...
Jits's user avatar
0votes
3answers
80views

find/detect file name goups

On fs i have files like: PREFIX_GROUPNAME_OTHERNAMES[.txt|.*] eg: A_ABC_A.txt A_ABC_B.txt A_ABC_C.txt A_XYZ_A.txt A_XYZ_B.txt A_XYZ_C.txt For some futher tasks i want to get the group names. $# ...
f b's user avatar
  • 13
-1votes
1answer
2kviews

Check if there exists filename in directory

I have one file contains people name, like Sam Tom Dad Jack I have one directory that contains name.txt or name.zip which file's form is not the same, like Dad.txt Tom.zip Jack.zip How to find sam ...
TangPing's user avatar
0votes
2answers
499views

Search for string in most recent file in directory

I wanted to grep a string from the most recent file in the current directory. By using the following command I am able to fetch most recent file but, not able to grep in that file only. $ ls -lrth -...
Adam Mulla's user avatar
0votes
1answer
618views

Sed Bash script only runs first line of sed

My bash script only runs first line of sed. The command i use to run it: sed -f sedhw.bash thesbians.txt Contents of sedhw.bash s/[0-9]*//g s/1908/---/g; s/1895/---/g; s/1903/---/g s/,.*//g s/^[^&...
Jimmy Gonzalez's user avatar
0votes
3answers
752views

Split a row by a delimiter

I have a space-separated text file, e.g. text1a text2a id1 text4a text5a text1b text2b id2 text4b text5b text1c text2c id3,id4 text4c text5c text1d text2d id5,id6,id7 text4d,text4di text5d The file ...
E. Rei's user avatar
-2votes
1answer
103views

List all of the files starting with sh, sr, se, th, tr or te

How can I list all of the files starting with the sequence sh, sr, se, th, tr or te (either letter could be upper or lowercase).
Mr Zezo's user avatar

153050per page
close